package cn.tedu.review;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;

/**
 * @author ：Dsi
 * @date ：2021/11/16 9:36
 * Describe    ：
 */
public class TestFile {
    public static void main(String[] args) throws IOException {
        File f1=new File("D:\\ready\\1.txt");
        System.out.println(f1.length());
        System.out.println(f1.exists());
        System.out.println(f1.isFile());
        System.out.println(f1.isDirectory());
        System.out.println(f1.getName());
        System.out.println(f1.getParent());
        System.out.println(f1.getAbsolutePath());
        System.out.println("4"+f1.getAbsoluteFile());

        File f2 = new File("D:\\a");
        System.out.println(f2.createNewFile());

        File f3 = new File("D:\\ready\\a\\d\\f");
        f3.mkdirs();
        f3.delete();//将上面文件的空文件f删除了
        System.out.println(Arrays.toString(new File("D:\\ready").listFiles()));
        File[] file=new File("D:\\").listFiles();
        System.out.println(Arrays.toString(file));
    }
}
